import { http } from "@/utils/http";

// 获取下载列表接口返回类型
export type ManualListResponse = {
  code: number;
  msg: "string";
  time: string;
  data: {
    total: number;
    page: number;
    limit: number;
    list: {
      id: number;
      info_name: string;
      info_url: string;
    };
  };
};
// 获取下载列表
export const getManualList = (page = 1, limit = 10) => {
  return http.request("get", "/api/manual/list", {
    params: {
      page,
      limit
    }
  });
};

// 获取下载详情
export const getManualDetail = (id: number, exhibitor_id?: number) => {
  return http.request("get", "/api/manual/detail", {
    params: {
      id,
      exhibitor_id
    }
  });
};

// 下载接口返回类型
export type DownloadResponse = {
  code: number;
  msg: string;
  time: string;
  data?: any;
};

// 下载
export const updateDownload = (id: number): Promise<DownloadResponse> => {
  return http.request("get", "/api/manual/download", {
    params: {
      id
    }
  });
};
